package demo

import "fmt"

// 定义接口
type Speaker interface {
	Speak() string
}

// 实现接口
type Dog struct{}

func (d Dog) Speak() string {
	return "Woof!"
}

func TestInterface() {
	var s Speaker = Dog{}
	fmt.Println(s.Speak())
}
